<template>
  <div class="box">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="网点承/业工资表" name="first">
        <el-row>
          <el-col :span="24">
            <div class="header">
              <el-form
                ref="form"
                :model="form"
                label-width="100px"
                class="flex-start"
              >
                <el-form-item label="单号">
                  <el-input
                    v-model="form.name"
                    placeholder="请输入单号"
                    style="width: 286px"
                  />
                </el-form-item>
                <el-form-item label="所属网点">
                  <el-select
                    v-model="form.region"
                    placeholder="请选择所属网点"
                    style="width: 286px"
                  >
                    <el-option label="区域一" value="shanghai" />
                    <el-option label="区域二" value="beijing" />
                  </el-select>
                </el-form-item>
                <el-form-item label="业务日期" style="width: 600px">
                  <el-date-picker
                    v-model="value1"
                    type="datetimerange"
                    range-separator="至"
                    start-placeholder="开始日期"
                    end-placeholder="结束日期"
                  />
                </el-form-item>
                <el-form-item>
                  <el-button type="primary" @click="onSubmit">查询</el-button>
                  <el-button>重置</el-button>
                </el-form-item>
                <el-form-item label="面单类型">
                  <el-select
                    v-model="form.region"
                    placeholder="请选择面单类型"
                    style="width: 286px"
                  >
                    <el-option label="区域一" value="shanghai" />
                    <el-option label="区域二" value="beijing" />
                  </el-select>
                </el-form-item>
                <el-form-item label="结算类型">
                  <el-select
                    v-model="form.region"
                    placeholder="请选择结算类型"
                    style="width: 286px"
                  >
                    <el-option label="区域一" value="shanghai" />
                    <el-option label="区域二" value="beijing" />
                  </el-select>
                </el-form-item>
                <el-form-item label="结算对象">
                  <el-select
                    v-model="form.region"
                    placeholder="请选择结算对象"
                    style="width: 286px"
                  >
                    <el-option label="区域一" value="shanghai" />
                    <el-option label="区域二" value="beijing" />
                  </el-select>
                </el-form-item>
              </el-form>
            </div>
          </el-col>
        </el-row>
        <el-row type="flex" justify="space-between">
          <el-col :span="6">
            <div>当前页共10项</div>
          </el-col>
          <el-col :span="10">
            <div>
              <el-button type="primary" @click="onSubmit">新增</el-button>
              <el-button type="primary" @click="onSubmit">删除</el-button>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <div>
              <el-table
                ref="multipleTable"
                border
                :data="tableData"
                tooltip-effect="dark"
                style="width: 100%"
                @selection-change="handleSelectionChange"
              >
                <el-table-column type="selection" width="55" />
                <el-table-column label="序号" width="120">
                  <template slot-scope="scope">{{ scope.row.date }}</template>
                </el-table-column>
                <el-table-column prop="name" label="所属网点" width="120" />
                <el-table-column
                  prop="address"
                  label="配置名称"
                  show-overflow-tooltip
                />
                <el-table-column prop="name" label="导出类型" width="120" />
                <el-table-column prop="name" label="导出对象名称" width="120" />
                <el-table-column prop="name" label="自动导出日期" width="120" />
                <el-table-column prop="name" label="创建日期" width="120" />
                <el-table-column prop="name" label="操作" width="120" />
              </el-table>
            </div>
          </el-col>
        </el-row>
        <div class="block" style="display: flex; justify-content: flex-end">
          <el-pagination
            :current-page="currentPage4"
            :page-sizes="[100, 200, 300, 400]"
            :page-size="100"
            layout="total, sizes, prev, pager, next, jumper"
            :total="400"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
          />
        </div>
      </el-tab-pane>
      <el-tab-pane label="工资表模板配置" name="second">
        <el-row>
          <el-col :span="24">
            <div class="header">
              <el-form
                ref="form"
                :model="form"
                label-width="100px"
                class="flex-start"
              >
                <el-form-item label="账单名称">
                  <el-select
                    v-model="form.region"
                    placeholder="请选择活动区域"
                    style="width: 286px"
                  >
                    <el-option label="区域一" value="shanghai" />
                    <el-option label="区域二" value="beijing" />
                  </el-select>
                </el-form-item>
                <el-form-item label="时间范围" style="width: 600px">
                  <div class="flex">
                    <el-radio v-model="radio" label="1">出账时间</el-radio>
                    <el-radio v-model="radio" label="2">收款时间</el-radio>
                    <el-date-picker
                      v-model="value1"
                      type="datetimerange"
                      range-separator="至"
                      start-placeholder="开始日期"
                      end-placeholder="结束日期"
                    />
                  </div>
                </el-form-item>
                <el-form-item label="账单类型">
                  <el-select
                    v-model="form.region"
                    placeholder="请选择账单类型"
                    style="width: 286px"
                  >
                    <el-option label="区域一" value="shanghai" />
                    <el-option label="区域二" value="beijing" />
                  </el-select>
                </el-form-item>
                <el-form-item>
                  <el-button type="primary" @click="onSubmit">查询</el-button>
                  <el-button>重置</el-button>
                </el-form-item>
                <el-form-item label="账单对象">
                  <el-select
                    v-model="form.region"
                    placeholder="请选择账单对象"
                    style="width: 286px"
                  >
                    <el-option label="区域一" value="shanghai" />
                    <el-option label="区域二" value="beijing" />
                  </el-select>
                </el-form-item>
                <el-form-item label="收款状态">
                  <el-select
                    v-model="form.region"
                    placeholder="请选择收款状态"
                    style="width: 286px"
                  >
                    <el-option label="区域一" value="shanghai" />
                    <el-option label="区域二" value="beijing" />
                  </el-select>
                </el-form-item>
                <el-form-item label="结算科目">
                  <el-select
                    v-model="form.region"
                    placeholder="请选择结算科目"
                    style="width: 286px"
                  >
                    <el-option label="区域一" value="shanghai" />
                    <el-option label="区域二" value="beijing" />
                  </el-select>
                </el-form-item>
                <el-form-item label="数据来源">
                  <el-select
                    v-model="form.region"
                    placeholder="请选择数据来源"
                    style="width: 286px"
                  >
                    <el-option label="区域一" value="shanghai" />
                    <el-option label="区域二" value="beijing" />
                  </el-select>
                </el-form-item>
                <el-form-item label="所属业务员">
                  <el-select
                    v-model="form.region"
                    placeholder="请选择所属业务员"
                    style="width: 286px"
                  >
                    <el-option label="区域一" value="shanghai" />
                    <el-option label="区域二" value="beijing" />
                  </el-select>
                </el-form-item>
                <el-form-item label="单号">
                  <el-input
                    v-model="form.name"
                    placeholder="请输入单号"
                    style="width: 286px"
                  />
                </el-form-item>
              </el-form>
            </div>
          </el-col>
        </el-row>
        <el-row type="flex" justify="space-between">
          <el-col :span="6">
            <div>当前页共10项</div>
          </el-col>
          <el-col :span="10">
            <div>
              <span
                style="color: red; font-size: 18px"
              >温馨提示: 已收金额不为0的账单无法删除，如需删除请先反核销
                操作收款登记</span>
              <el-button type="primary" @click="onSubmit">新增</el-button>
              <el-button type="primary" @click="onSubmit">删除</el-button>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <div>
              <el-table
                ref="multipleTable"
                border
                :data="tableData"
                tooltip-effect="dark"
                style="width: 100%"
                @selection-change="handleSelectionChange"
              >
                <el-table-column type="selection" width="55" />
                <el-table-column label="序号" width="120">
                  <template slot-scope="scope">{{ scope.row.date }}</template>
                </el-table-column>
                <el-table-column prop="name" label="所属网点" width="120" />
                <el-table-column
                  prop="address"
                  label="配置名称"
                  show-overflow-tooltip
                />
                <el-table-column prop="name" label="导出类型" width="120" />
                <el-table-column prop="name" label="导出对象名称" width="120" />
                <el-table-column prop="name" label="自动导出日期" width="120" />
                <el-table-column prop="name" label="创建日期" width="120" />
                <el-table-column prop="name" label="操作" width="120" />
              </el-table>
            </div>
          </el-col>
        </el-row>
        <div class="block" style="display: flex; justify-content: flex-end">
          <el-pagination
            :current-page="currentPage4"
            :page-sizes="[100, 200, 300, 400]"
            :page-size="100"
            layout="total, sizes, prev, pager, next, jumper"
            :total="400"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
          />
        </div>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
export default {
  data() {
    return {
      activeName: 'first',
      form: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        currentPage4: 4,
        desc: ''

      },
      tableData: [{
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-08',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-06',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-07',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }]
    }
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event)
    }
  }

}
</script>

<style lang="scss" scoped>
.box {
  padding: 20px;
}

.flex {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-start {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
}

.header {
  padding-bottom: 20px;
  border-bottom: 1px solid #ccc;
}

.el-row {
  margin-bottom: 20px;

  &:last-child {
    margin-bottom: 0;
  }
}

.el-col {
  border-radius: 4px;
}

.bg-purple-dark {
  background: #99a9bf;
}

.bg-purple {
  background: #d3dce6;
}

.bg-purple-light {
  background: #e5e9f2;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}

.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
</style>
